﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NewStartModels.Models.User;
using BusinessPlatform.Data;

namespace NewStartModels.Models.ModelServices
{
    public sealed class CurrentUser : ICurrentUser
    {
        /// <summary>
        /// 当前用户实例
        /// </summary>
        private static ICurrentUser curUser;
        private static object mylook = new object();
        private CurrentUser()
        {

        }
        /// <summary>
        /// 类的实例
        /// </summary>
        public static ICurrentUser Instance
        {
            get
            {
                if (curUser == null)
                {
                    lock (mylook)
                    {
                        if (curUser == null)
                            curUser = new CurrentUser();
                    }
                }
                return curUser;
            }
        }

        public int UserId { get; set; }

        public string UserCode { get; set; }

        public string UserName { get; set; }

        public string Password { get; set; }

        public Enumerator.BOYesOrNo IsSupperUser { get; set; }

        public DateTime LoginDateTime { get; set; }

        public string LoginMachineName { get; set; }

        public string LoginMachineIP { get; set; }
    }
}
